package com.prpat;

import java.util.Scanner;
import java.util.regex.MatchResult;

public class Test 
{

	public static void main(String[] args) 
	{
		System.out.println("Parsing: lvl=100 (1818 KB for nbparts) 11 K possible passwords (11461)");
	     
	     String input1 = "lvl=100 (1818 KB for nbparts) 11 G possible passwords (11461)";
	     
	     Scanner s1 = new Scanner(input1);
	     
	     s1.findInLine("lvl=(\\d+) \\((\\d+) KB for nbparts\\) (\\d+) [KMG] possible passwords \\((\\d+)\\)");
	     
	     MatchResult result1 = s1.match();
	     for (int i=1; i<=result1.groupCount(); i++)
	      System.out.println(result1.group(i));
	     
	     s1.close();



	}

}
